function DirectionString ( [string] $strDegrees ) 
{ 
    $iDegrees = [Int32]::Parse($strDegrees) 
    if( ($iDegrees -eq 0) -or ($iDegrees -eq 360) ) 
    { 
        return "North" 
    } 
    elseif( ($iDegrees -gt 0) -and ($iDegrees -lt 24) ) 
    { 
        return "North" 
    } 
    elseif( ($iDegrees -gt 23) -and ($iDegrees -lt 69) ) 
    { 
        return "North East" 
    } 
    elseif( ($iDegrees -gt 68) -and ($iDegrees -lt 114) ) 
    { 
        return "East" 
    } 
    elseif( ($iDegrees -gt 113) -and ($iDegrees -lt 159) ) 
    { 
        return "South East" 
    } 
    elseif( ($iDegrees -gt 158) -and ($iDegrees -lt 204) ) 
    { 
        return "South" 
    } 
    elseif( ($iDegrees -gt 203) -and ($iDegrees -lt 249) ) 
    { 
        return "South West" 
    } 
    elseif( ($iDegrees -gt 248) -and ($iDegrees -lt 294) ) 
    { 
        return "West" 
    } 
    elseif( ($iDegrees -gt 293) -and ($iDegrees -lt 339) ) 
    { 
        return "North West" 
    } 
    elseif( ($iDegrees -gt 338) -and ($iDegrees -lt 360) ) 
    { 
        return "North" 
    } 
} 
 
function CalculateVisibility ( [string] $strVisibility ) 
{ 
    $v = [Double]::Parse($strVisibility) 
    if ($v -gt 0.0) 
    { 
        return ($v / 100.0).ToString("F2") 
    } 
    else 
    { 
        return "0" 
    } 
} 
 
$p = "USWA0347" # <<<<< Change this for your location 
 
$url = "http://xml.weather.yahoo.com/forecastrss?p=" + $p + "&u=f" 
 
$strTrend = "steady", "rising", "falling" 
 
"" 
"Loading weather data from Yahoo! Weather ..." 
"" 
 
$doc = [xml] (New-Object System.Net.WebClient).DownloadString($url) 
 
$strTempUnits = $doc.rss.channel.units.temperature 
$strPressureUnits = $doc.rss.channel.units.pressure 
$strWindSpeedUnits = $doc.rss.channel.units.speed 
$strDistanceUnits = $doc.rss.channel.units.distance 
 
cls 
"" 
$doc.rss.channel.title 
"" 
$doc.rss.channel.item.condition.date 
"" 
"Condition:   " + $doc.rss.channel.item.condition.text 
"Temperature: " + $doc.rss.channel.item.condition.temp + "° " + $strTempUnits 
"Wind chill:  " + $doc.rss.channel.wind.chill + "° " + $strTempUnits 
"Humidity:    " + $doc.rss.channel.atmosphere.humidity + "%" 
"Pressure:    " + $doc.rss.channel.atmosphere.pressure + " " + $strPressureUnits + " and " + $strTrend[[Int32]::Parse($doc.rss.channel.atmosphere.rising)] 
if($doc.rss.channel.wind.speed -eq "0") 
{ 
    "Wind:        " + "calm" 
} 
else 
{ 
    "Wind:        " + "from the " + (DirectionString $doc.rss.channel.wind.direction) + " at " + $doc.rss.channel.wind.speed + " " + $strWindSpeedUnits 
} 
"Visibility:  " + (CalculateVisibility $doc.rss.channel.atmosphere.visibility) + " " + $strDistanceUnits 
"Sunrise:     " + $doc.rss.channel.astronomy.sunrise 
"Sunset:      " + $doc.rss.channel.astronomy.sunset 
"" 
"Forecast for " + $doc.rss.channel.item.forecast[0].day + " " + $doc.rss.channel.item.forecast[0].date 
" Condition:  " + $doc.rss.channel.item.forecast[0].text 
" Low:        " + $doc.rss.channel.item.forecast[0].low + "° " + $strTempUnits 
" High:       " + $doc.rss.channel.item.forecast[0].high + "° " + $strTempUnits 
 
"" 
"Forecast for " + $doc.rss.channel.item.forecast[1].day + " " + $doc.rss.channel.item.forecast[1].date 
" Condition:  " + $doc.rss.channel.item.forecast[1].text 
" Low:        " + $doc.rss.channel.item.forecast[1].low + "° " + $strTempUnits 
" High:       " + $doc.rss.channel.item.forecast[1].high + "° " + $strTempUnits 
"" 